package com.quanyan.common.validation.enums;

import com.quanyan.common.utils.RegexUtils;
import com.quanyan.common.validation.validator.MoneyFormatValidator;

import javax.validation.Constraint;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.Payload;
import java.lang.annotation.*;
import java.math.BigDecimal;
import java.util.regex.Matcher;


/**
 * 金额校验。要求保留小数到后2位
 * Created by Zheng.Ke
 * Date 2016/8/29.
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = MoneyFormatValidator.class)
@Documented
public @interface Money {
    String message() default "小数点后从第三数开始，不能有非0值";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
